package com.ztx.pagemodel.easyui;

import java.io.Serializable;

import org.apache.ibatis.session.RowBounds;

/**
 * easyUI分页帮助类
 *
 */
public class PageHelper implements Serializable {

	private static final long serialVersionUID = 8874811113293465145L;
	/** 当前页数 */
	private int page = 1;
	/** 每页显示记录数 */
	private int rows = 10;
	/** 排序字段 */
	private String sort;
	/** asc desc */
	private String order;

	/** 计算分页 */
	public RowBounds getRowBounds() {
		return new RowBounds((this.page - 1) * this.rows, this.rows);
	}

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getRows() {
		return rows;
	}

	public void setRows(int rows) {
		this.rows = rows;
	}

	public String getSort() {
		return sort;
	}

	public void setSort(String sort) {
		this.sort = sort;
	}

	public String getOrder() {
		return order;
	}

	public void setOrder(String order) {
		this.order = order;
	}

}
